package reflect;

import java.lang.reflect.Method;
import java.util.Scanner;

public class ReflectDemo1 {
    public static void main(String[] args) throws ClassNotFoundException {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入类名");
        String classname = scanner.nextLine();
        Class cls =Class.forName(classname);
        String str = cls.getName();
        System.out.println(str);
        str = cls.getSimpleName();
        System.out.println(str);
        Package pack = cls.getPackage();
        String sta = pack.getName();
        System.out.println(sta);
        Method[] methods = cls.getMethods();
        for (Method method : methods){
            String moth = method.getName();
            System.out.println(moth);
        }
    }
}
